<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/grsun" prefix="grsun"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<meta name="description" content="Mailbox with some customizations as described in docs" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<%@ include file="/include/main_include.jsp"%>
<%@ include file="/include/form_include.jsp"%>
 
</head>
<body>
	<div class="modal-body" style="max-height: 716px;">
		<div id="divform" class="row mx-dialog-c bs_dialog open"> 
		   <form id="dataForm" class="form-horizontal" method="post"> 
		   <input type="hidden" id="orderId" name="orderId" value="${pd.orderId}"/>   
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title"></label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="orderId" name="orderId" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.orderId}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">用户id</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="userId" name="userId" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.userId}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">下单人名</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="userName" name="userName" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.userName}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">下单时间</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="addTime" name="addTime" type="number" class="width-100 mx-input-group" style="height:33px;" value="${pd.addTime}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">送货时间</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="sendTime" name="sendTime" type="number" class="width-100 mx-input-group" style="height:33px;" value="${pd.sendTime}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">成功时间</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="successTime" name="successTime" type="number" class="width-100 mx-input-group" style="height:33px;" value="${pd.successTime}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">支付状态1支付</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="payStatus" name="payStatus" type="number" class="width-100 mx-input-group" style="height:33px;" value="${pd.payStatus}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">订单状态</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="orderStatus" name="orderStatus" type="number" class="width-100 mx-input-group" style="height:33px;" value="${pd.orderStatus}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">配送费</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="sendFee" name="sendFee" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.sendFee}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">配送人</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="sendUserId" name="sendUserId" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.sendUserId}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">配送人名</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="sendUserName" name="sendUserName" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.sendUserName}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">总数量</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="totalCount" name="totalCount" type="number" class="width-100 mx-input-group" style="height:33px;" value="${pd.totalCount}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">订单金额</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="totalPrice" name="totalPrice" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.totalPrice}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">折扣金额</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="discountPrice" name="discountPrice" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.discountPrice}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">商户id</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="businessId" name="businessId" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.businessId}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">商户名称</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="businessName" name="businessName" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.businessName}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">房间id</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="roomId" name="roomId" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.roomId}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">房间号</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="room" name="room" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.room}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">支付方式</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="payWay" name="payWay" type="number" class="width-100 mx-input-group" style="height:33px;" value="${pd.payWay}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">退款数量</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="refundCount" name="refundCount" type="number" class="width-100 mx-input-group" style="height:33px;" value="${pd.refundCount}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">退款金额</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="refundFee" name="refundFee" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.refundFee}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">商家用户id</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="businessUserId" name="businessUserId" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.businessUserId}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title"></label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="diningId" name="diningId" type="number" class="width-100 mx-input-group" style="height:33px;" value="${pd.diningId}">
		        </div>
		    </div>
			<div class="form-group col-lg-6 col-sm-6 col-xs-6">
		        <label class="control-label mx-group-title">桌牌名称</label>
		        <div class="mx-group-control" style="height:33px;">
					<input id="diningName" name="diningName" type="text" class="width-100 mx-input-group" style="height:33px;" value="${pd.diningName}">
		        </div>
		    </div>
		  </form>                  
		</div>
	</div>
	<script type="text/javascript">
	$(function() {
		$('#dataForm').validate({
			submitHandler : function(form) {
				var index = parent.layer.getFrameIndex(window.name);
				$.uitools.showLoading();//打开处理中遮罩层
				$.ajax({
					cache : true,
					type : "POST",
					url : rootpath + '/hhOrder/save.do',
					data : $('#dataForm').serialize(),
					error : function(request) {
						$.uitools.hideLoading();//关闭处理中遮罩层
						layer.msg('系统异常！', {
							icon : 2,
							time : 1000
						}, function() {
							parent.layer.close(index);
						})
					},
					success : function(data) {
						$.uitools.hideLoading();//关闭处理中遮罩层
						if (data.code==0) {
							layer.msg('提交成功！', {
								icon : 1,
								time : 1000
							}, function() {
								parent.layer.close(index);
								//刷新列表
								parent.dataTable.datagrid('reload');
							})
						} else {
							layer.msg('提交异常！', {
								icon : 2,
								time : 1000
							}, function() {
								parent.layer.close(index);
							})
						}
					}
				});
			},
			rules : {
				orderId : { required : true },
				userId : { required : true },
				userName : { required : true },
				addTime : { required : true ,number : true},
				sendTime : { required : true ,number : true},
				successTime : { required : true ,number : true},
				payStatus : { required : true ,number : true},
				orderStatus : { required : true ,number : true},
				sendFee : { required : true },
				sendUserId : { required : true },
				sendUserName : { required : true },
				totalCount : { required : true ,number : true},
				totalPrice : { required : true },
				discountPrice : { required : true },
				businessId : { required : true },
				businessName : { required : true },
				roomId : { required : true },
				room : { required : true },
				payWay : { required : true ,number : true},
				refundCount : { required : true ,number : true},
				refundFee : { required : true },
				businessUserId : { required : true },
				diningId : { required : true ,number : true},
				diningName : { required : true }
			},
			messages : {
				orderId : { required : '请输入' },
				userId : { required : '请输入用户id' },
				userName : { required : '请输入下单人名' },
				addTime : { required : '请输入下单时间' },
				sendTime : { required : '请输入送货时间' },
				successTime : { required : '请输入成功时间' },
				payStatus : { required : '请输入支付状态1支付' },
				orderStatus : { required : '请输入订单状态' },
				sendFee : { required : '请输入配送费' },
				sendUserId : { required : '请输入配送人' },
				sendUserName : { required : '请输入配送人名' },
				totalCount : { required : '请输入总数量' },
				totalPrice : { required : '请输入订单金额' },
				discountPrice : { required : '请输入折扣金额' },
				businessId : { required : '请输入商户id' },
				businessName : { required : '请输入商户名称' },
				roomId : { required : '请输入房间id' },
				room : { required : '请输入房间号' },
				payWay : { required : '请输入支付方式' },
				refundCount : { required : '请输入退款数量' },
				refundFee : { required : '请输入退款金额' },
				businessUserId : { required : '请输入商家用户id' },
				diningId : { required : '请输入' },
				diningName : { required : '请输入桌牌名称' }
			},
			// 失去焦点时不执行验证
			onfocusout : false,
			// 错误提示，错误对象
			errorPlacement : function(error, element) {
				// 1.错误信息，2提示位置，3同时提示多个错误
				layer.tips(error[0].innerText, element, {
					// 错误信息可以同时提示多个，...
					tipsMore : true,
					tips : [ 3, '#D16E6C' ]
				});
			}
		});
	});
	</script>
</body>
</html>
